36779a119236bffce89dc5668565bfc1e03df996,opennms-webapp/src/main/java/org/opennms/web/controller/admin/thresholds/ThresholdController.java,ThresholdController,finishThresholdEdit,#HttpServletRequest#,436

Before Change


                //It was a new Threshold, but the user hit cancel.  Remove the new threshold from the group
                group.removeThreshold(threshold);
            } else {
                ArrayList filters = (ArrayList)request.getSession(false).getAttribute("savedFilters");
                threshold.setResourceFilterCollection(filters);
            }
        } else {
            return finishThresholdFilterEdit(request);
        }
        request.getSession(false).removeAttribute("savedFilters");
        //and got back to the editGroup page
        modelAndView=new ModelAndView("admin/thresholds/editGroup");
        modelAndView.addObject("group",configFactory.getGroup(groupName));

After Change


        }
    }

    private ModelAndView finishThresholdEdit(HttpServletRequest request) throws ServletException {
        ThresholdingConfigFactory configFactory=ThresholdingConfigFactory.getInstance();
        ModelAndView modelAndView;
        String groupName=request.getParameter("groupName");
        String submitAction=request.getParameter("submitAction");
        Group group=configFactory.getGroup(groupName);
        String thresholdIndexString=request.getParameter("thresholdIndex");
        if(thresholdIndexString==null) {
            throw new ServletException("thresholdIndex parameter required to delete a threshold");
        }
        int thresholdIndex=Integer.parseInt(thresholdIndexString);
        Threshold threshold=group.getThreshold(thresholdIndex);
        
        if(SAVE_BUTTON_TITLE.equals(submitAction)) {
            this.commonFinishEdit(request, threshold);
            threshold.setDsName(request.getParameter("dsName"));
            saveChanges();
         } else if (CANCEL_BUTTON_TITLE.equals(submitAction)) {
            String isNew=request.getParameter("isNew");
            if("true".equals(isNew)) {
                //It was a new Threshold, but the user hit cancel.  Remove the new threshold from the group
                group.removeThreshold(threshold);
            } else {
                List<ResourceFilter> filters = getFilterList(request, false);
                if (filters != null)
                	threshold.setResourceFilter(filters);
            }
        } else {
            return finishThresholdFilterEdit(request, threshold);
        }
        // Remove Filters from Session
        setFilterList(request, null);
        
        //and got back to the editGroup page
        modelAndView=new ModelAndView("admin/thresholds/editGroup");